/*
 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 SPDX-License-Identifier: Apache-2.0
*/

@use 'sass:map';
@use '../internal/styles/typography/constants.scss' as styles;
@use '../internal/styles/tokens' as awsui;

$link-font-sizes: (
  'body-s': (
    'text-underline-offset': 0.3em,
    'text-decoration-thickness': 1px,
  ),
  'body-m': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
  'heading-xs': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
  'heading-s': (
    'text-underline-offset': 0.3em,
    'text-decoration-thickness': 1px,
  ),
  'heading-m': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
  'heading-l': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
  'heading-xl': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
  'display-l': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 2px,
  ),
  'inherit': (
    'text-underline-offset': 0.25em,
    'text-decoration-thickness': 1px,
  ),
);

$link-variants: (
  'secondary': (
    'text-color-default': awsui.$color-text-link-default,
    'text-color-hover': awsui.$color-text-link-hover,
    'text-color-active': awsui.$color-text-link-hover,
    'font-weight': inherit,
    'decoration-line': none,
    'decoration-color': transparent,
    'decoration-color-hover': currentColor,
    'letter-spacing': normal,
  ),
  'primary': (
    'text-color-default': awsui.$color-text-link-default,
    'text-color-hover': awsui.$color-text-link-hover,
    'text-color-active': awsui.$color-text-link-hover,
    'font-weight': inherit,
    'decoration-line': underline,
    'decoration-color': currentColor,
    'decoration-color-hover': currentColor,
    'letter-spacing': normal,
  ),
  'info': (
    'text-color-default': awsui.$color-text-link-default,
    'text-color-hover': awsui.$color-text-link-hover,
    'text-color-active': awsui.$color-text-link-hover,
    'font-weight': styles.$font-weight-bold,
    'decoration-line': none,
    'decoration-color': transparent,
    'decoration-color-hover': awsui.$color-text-link-button-underline-hover,
    'letter-spacing': styles.$letter-spacing-bold-link,
  ),
  'value-large': (
    'text-color-default': awsui.$color-text-link-default,
    'text-color-hover': awsui.$color-text-link-hover,
    'text-color-active': awsui.$color-text-link-hover,
    'font-weight': awsui.$font-box-value-large-weight,
    'decoration-line': underline,
    'decoration-color': currentColor,
    'decoration-color-hover': currentColor,
  ),
  'top-navigation': (
    'text-color-default': awsui.$color-text-interactive-default,
    'text-color-hover': awsui.$color-text-interactive-hover,
    'text-color-active': awsui.$color-text-interactive-active,
    'font-weight': styles.$font-weight-bold,
    'decoration-line': none,
    'decoration-color': transparent,
    'decoration-color-hover': transparent,
    'letter-spacing': styles.$letter-spacing-bold-link,
  ),
  // Need separate variant used for backwards compatible styles in classic
  // (vr - button style, classic - underlined link style),
  'recovery': (
      'text-color-default': awsui.$color-text-link-default,
      'text-color-hover': awsui.$color-text-link-hover,
      'text-color-active': awsui.$color-text-link-hover,
      'font-weight': awsui.$font-link-button-weight,
      'decoration-line': underline,
      'decoration-color': awsui.$color-text-link-button-underline,
      'decoration-color-hover': awsui.$color-text-link-button-underline-hover,
      'letter-spacing': awsui.$font-link-button-letter-spacing,
    ),
);

$link-styles: (
  // A link without an href to be styled like a button
  'button': (
      'text-color-default': awsui.$color-text-link-button-normal-default,
      'text-color-hover': awsui.$color-text-link-button-normal-hover,
      'text-color-active': awsui.$color-text-link-button-normal-active,
      'font-weight': styles.$font-weight-bold,
      'decoration-line': none,
      'decoration-color': transparent,
      'decoration-color-hover': transparent,
      'letter-spacing': awsui.$font-button-letter-spacing,
    )
);
